home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / T-Z / Text ViewerHYPE.cpt / TextViewer / stack_-1.xml < prev    next >
Extensible Markup Language  |  1991-10-14  |  4KB  |  21 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>1</cardCount>
  7.     <cardID>2948</cardID>
  8.     <listID>4521</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>on openStackcreate menu "Viewer"put "About Viewer...,-,View Document...,Save Document...,Print Document,-,Remove Line Feeds,-,Word Count..." into menu "viewer"go to card 2end openStackon doMenu whichMenuif whichMenu is "About viewer..." then aboutviewif whichMenu is "View Document..." then viewDocif whichMenu is "Save Document..." then saveDocif whichMenu is "REmove Line Feeds" then remLFsif whichMenu is "Print Document" then printDocif whichMenu is "Word Count..." then wordDocelse pass doMenuend doMenuon aboutViewanswer "This is a simple text viewer utility.  By adding a menuItem to your home stack you can have access to this utility at anytime."¬¨& return & return & "v1.0   ¬© 1991, Dirk Marek ‚Ä¢ CIS-76177,3212 ‚Ä¢ AOL-Marekdi ‚Ä¢ Prodigy-CRJP87A" with "How??" or "Okay"if it is "How??"then answer "Sample Home Stack scripts can be found in the script of this background."end aboutViewon viewDoccleanUpanswer file "Select the text file you would like to view..." of type "Text"put the result into resultCodeif resultCode is emptythenlock screenput it into fileNameopen file fileNamerepeat foreverread from file fileName for 25000if it is empty then exit repeatelsedoMenu "New Card"put it into bg fld textend ifend repeatelse exit viewDocclose file fileNamego to card 2put fileName into bg fld textfileNameunlock screenend viewDocon cleanUplock screenget the number of cards of this stackrepeat with x = it down to 2go to card xdoMenu "Delete Card"end repeatput empty into bg fld "page#"put empty into bg fld "of#"put empty into bg fld textfileNamedoMenu "compact stack"unlock screenend cleanUpon saveDocask file "Save text as:" with "text"if it is empty then exit saveDocput it into filenameopen file filenamerepeat with x = 2 to the number of cardsput empty into writetextgo to card xput bg fld text into writetextput return into last line of writetextwrite writetext to file filenameend repeatclose file filenameend SaveDocon remLFsset the cursor to watchpush cardlock screenrepeat with y = 2 to the number of cardsgo to card yrepeat with x = the number of lines of bg fld text down to 1if char 1 of line x of bg fld text = "
  17. " then delete char 1 of line x of bg fld textend repeatend repeatpop cardunlock screenanswer "Line feeds removed."end remLFson printDocrepeat with x = 1 to the number of cardsgo to card xif bg fld text is not empty then print bg field textend repeatend printDocon closeStackdelete menu "viewer"end closeStackon openCardput (the number of this card - 1) into bg fld "page#"put the number of cards - 1 into bg fld "of#"pass openCardend openCardon wordDocpush cardanswer "Get the number of ...?" with "Words" or "Characters" or "Cancel"if it = "Cancel" then exit wordDocif it = "Words"thenlock screenput 0 into temprepeat with x = 2 to the number of cardsgo to card xput the number of words of bg fld "text" + temp into tempend repeatpop cardunlock screenanswer "There are " & temp & " words in this document."elselock screenput 0 into temprepeat with x = 2 to the number of cardsgo to card xput the number of chars of bg fld "text" + temp into tempend repeatpop cardunlock screenanswer "There are " & temp & " characters in this document."end ifend wordDoc</script>
  18.     <background id="2800" file="background_2800.xml" name="" />
  19.     <card id="2948" file="card_2948.xml" marked="false" name="" owner="2800" />
  20. </stack>
  21.